package com.ruoyi.health.api.factory;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.customer.api.factory.RemoteCustomerFallbackFactory;
import com.ruoyi.health.api.RemoteHealthService;
import com.ruoyi.iot.api.RemoteIotService;
import com.ruoyi.iot.api.domain.HealthDatas;
import com.ruoyi.iot.api.domain.HeathParam;
import com.ruoyi.iot.api.domain.WatchInfoVO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.web.bind.annotation.RequestBody;

public class RemoteHealthFallbackFactory implements FallbackFactory<RemoteHealthService> {
    private static final Logger log = LoggerFactory.getLogger(RemoteHealthFallbackFactory.class);
    @Override
    public RemoteHealthService create(Throwable cause) {
        log.error("报告服务调用失败:{}", cause.getMessage());
        return new RemoteHealthService() {


            @Override
            public void createHealthReportTask(String date,String source) {
                R.fail("定时任务生成健康日报失败");
            }

            @Override
            public void createHealthReportByWeekTasK(String date, String source) {
                R.fail("定时任务生成健康周报失败");
            }

            @Override
            public void createHealthReportByMonthTasK(String date, String source) {
                R.fail("定时任务生成健康月报失败");
            }
        };
    }
}
